/*============================================================================
* Author        : Li Ji
* Mail          : leejearl@126.com
* Last modified : 2015-03-02 21:42
* Filename      : CGKS.cpp
* Description   :
*
=============================================================================*/

#include "CConfig.hpp"
#include "CGeometry.hpp"

#include <iostream>
#include <stdexcept>
#include <string>
using namespace std;

int main(int argc, char* argv[])
{
    if(argc == 1)
    {
        throw runtime_error("There is no config file!");
    }

    cout << "------------------------------Loading configfile ------------------------------" << endl;
    string configFile(argv[1]);
    cout << "The configfile is " << configFile << "."<< endl;
    CConfig* config = new CConfig(configFile);
    config->init();

    cout << "------------------------------Geometry Preprocessing---------------------------" << endl;
    CGeometry* geo = new CGeometry();
    cout << "Loading MeshFile..."<< endl;
    geo->loadmesh(config);
    cout << "Creating the geometry connection..." << endl;
    geo->setPointNeighborPoint();
    geo->setInterfaceNormal();
    geo->setElemVolume();


    delete geo;


    return 1;
}
